package com.erp.common.web.pagination;

import java.util.List;

import com.erp.framework.pagination.Pageable;

public class Page implements Pageable {
	private int index = -1;
	private boolean isFetched = false;
	private List items = null;
	
	public Page(int index) {
		this.index = index;
	}

	public int getPageIndex() {
		return index;
	}

	public void putItems(List items) {
		if (items == null)
			throw new PageAccessException("Page Items list is null.");
		
		this.items = items;
		isFetched = true;
	}

	public List getItems() {
		return items;
	}

	public boolean isFetched() {
		return isFetched;
	}

	public void setPageIndex(int index) {
		this.index = index;
	}
}
